<template>
  <el-carousel :interval="4000" type="card" height="250px" indicator-position="none">
    <el-carousel-item v-for="(item,index) in swiperData" :key="index">
      <span class="title" :style="{backgroundColor: item.titleColor}">{{item.typeTitle}}</span>
      <a :href="item.url" target="_blank">
        <img :src="item.imageUrl" alt="">
      </a>
    </el-carousel-item>
  </el-carousel>
</template>

<script>
export default {
  name: 'PersonalSwiper',
  props: {
    swiperData: {
      type: Array,
      default() {
        return []
      }
    }
  }
}
</script>

<style lang="less" scoped>
.el-carousel {
  overflow: hidden;
  margin-bottom: 20px;
  .el-carousel__item {
    overflow: hidden;
    height: 100%;
    border-radius: 20px;
    .title {
      position: absolute;
      bottom: 0;
      right: 0;
      color: #fff;
      font-size: 12px;
      height: 12px;
      line-height: 12px;
      padding: 5px 10px;
      border-radius: 10px 0 10px 0;
    }
    a {
      height: 100%;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}
</style>